3.7.89 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx\) [689]
Optimal. Leaf size=151 \[ \frac {4 a^3 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (i A+2 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {a^3 (i A+5 B) (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}-\frac {a^3 B (c-i c \tan (e+f x))^{3+n}}{c^3 f (3+n)} \]
[Out]
4*a^3*(I*A+B)*(c-I*c*tan(f*x+e))^n/f/n-4*a^3*(I*A+2*B)*(c-I*c*tan(f*x+e))^(1+n)/c/f/(1+n)+a^3*(I*A+5*B)*(c-I*c
*tan(f*x+e))^(2+n)/c^2/f/(2+n)-a^3*B*(c-I*c*tan(f*x+e))^(3+n)/c^3/f/(3+n)
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 151, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {a^3 (5 B+i A) (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac {4 a^3 (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (2 B+i A) (c-i c \tan (e+f x))^{n+1}}{c f (n+1)}-\frac {a^3 B (c-i c \tan (e+f x))^{n+3}}{c^3 f (n+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]
[Out]
(4*a^3*(I*A + B)*(c - I*c*Tan[e + f*x])^n)/(f*n) - (4*a^3*(I*A + 2*B)*(c - I*c*Tan[e + f*x])^(1 + n))/(c*f*(1
+ n)) + (a^3*(I*A + 5*B)*(c - I*c*Tan[e + f*x])^(2 + n))/(c^2*f*(2 + n)) - (a^3*B*(c - I*c*Tan[e + f*x])^(3 +
n))/(c^3*f*(3 + n))
Rule 78
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
Rule 3669
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx &=\frac {(a c) \text {Subst}\left (\int (a+i a x)^2 (A+B x) (c-i c x)^{-1+n} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (4 a^2 (A-i B) (c-i c x)^{-1+n}-\frac {4 a^2 (A-2 i B) (c-i c x)^n}{c}+\frac {a^2 (A-5 i B) (c-i c x)^{1+n}}{c^2}+\frac {i a^2 B (c-i c x)^{2+n}}{c^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {4 a^3 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {4 a^3 (i A+2 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {a^3 (i A+5 B) (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}-\frac {a^3 B (c-i c \tan (e+f x))^{3+n}}{c^3 f (3+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(822\) vs. \(2(151)=302\).
time = 8.44, size = 822, normalized size = 5.44 \begin {gather*} \frac {\cos ^4(e+f x) \left (\frac {\sec (e) \sec ^2(e+f x) (3 A \cos (e)-9 i B \cos (e)+A n \cos (e)-2 i B n \cos (e)+2 B \sin (e)+B n \sin (e)) \left (-i e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \cos (3 e)-e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \sin (3 e)\right )}{(2+n) (3+n)}+\frac {\sec (e) \left (12 i A \cos (e)+12 B \cos (e)+13 i A n \cos (e)+9 B n \cos (e)+6 i A n^2 \cos (e)+6 B n^2 \cos (e)+i A n^3 \cos (e)+B n^3 \cos (e)-9 A n \sin (e)+13 i B n \sin (e)-6 A n^2 \sin (e)+6 i B n^2 \sin (e)-A n^3 \sin (e)+i B n^3 \sin (e)\right ) \left (\frac {2 e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \cos (3 e)}{n}-\frac {2 i e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \sin (3 e)}{n}\right )}{(1+n) (2+n) (3+n)}+\frac {\left (9 A-13 i B+6 A n-6 i B n+A n^2-i B n^2\right ) \sec (e) \sec (e+f x) \left (-2 e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \cos (3 e)+2 i e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \sin (3 e)\right ) \sin (f x)}{(1+n) (2+n) (3+n)}-\frac {i \sec (e) \sec ^3(e+f x) \left (B e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \cos (3 e)-i B e^{-i f n x+n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \sin (3 e)\right ) \sin (f x)}{3+n}\right ) (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-\frac {n (-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))}{\log (c-i c \tan (e+f x))}}}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]
[Out]
(Cos[e + f*x]^4*((Sec[e]*Sec[e + f*x]^2*(3*A*Cos[e] - (9*I)*B*Cos[e] + A*n*Cos[e] - (2*I)*B*n*Cos[e] + 2*B*Sin
[e] + B*n*Sin[e])*((-I)*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3*e]
- E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e]))/((2 + n)*(3 + n)) +
(Sec[e]*((12*I)*A*Cos[e] + 12*B*Cos[e] + (13*I)*A*n*Cos[e] + 9*B*n*Cos[e] + (6*I)*A*n^2*Cos[e] + 6*B*n^2*Cos[e
] + I*A*n^3*Cos[e] + B*n^3*Cos[e] - 9*A*n*Sin[e] + (13*I)*B*n*Sin[e] - 6*A*n^2*Sin[e] + (6*I)*B*n^2*Sin[e] - A
*n^3*Sin[e] + I*B*n^3*Sin[e])*((2*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))
*Cos[3*e])/n - ((2*I)*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])/n
))/((1 + n)*(2 + n)*(3 + n)) + ((9*A - (13*I)*B + 6*A*n - (6*I)*B*n + A*n^2 - I*B*n^2)*Sec[e]*Sec[e + f*x]*(-2
*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3*e] + (2*I)*E^((-I)*f*n*x +
n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])*Sin[f*x])/((1 + n)*(2 + n)*(3 + n)) -
(I*Sec[e]*Sec[e + f*x]^3*(B*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3
*e] - I*B*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])*Sin[f*x])/(3
+ n))*(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^(n - (n*(-Log[c*Sec[e + f*x]] + Log
[c - I*c*Tan[e + f*x]]))/Log[c - I*c*Tan[e + f*x]]))/(f*(Cos[f*x] + I*Sin[f*x])^3*(A*Cos[e + f*x] + B*Sin[e +
f*x]))
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 1.32, size = 4339, normalized size = 28.74
| | |
method |
result |
size |
| | |
risch |
\(\text {Expression too large to display}\) |
\(4339\) |
| | |
|
|
|
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x,method=_RETURNVERBOSE)
[Out]
4*a^3/(3+n)/f/(exp(2*I*(f*x+e))+1)^3/(1+n)/(2+n)/n*(-n^3*B/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn
(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I
*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I
*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+n^3*B/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*
Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi
*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))
*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+6*n^2*B/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*ex
p(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp
(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*
x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+11*n*B/((exp(2*I*(f*x+e))+1)^n)*2^
n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c
)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp
(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+18*I*A/((exp(2*I*(f*x+e))+
1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*
csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(
I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(2*I*f*x)*exp(2*I*e)+18*I*A/((exp(2*I*(
f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e)
)+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*
Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+6*I*A/((ex
p(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*
(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(
-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)-2*n
^2*B/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/
(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1)
)*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4
*I*e)+9*n*B/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*cs
gn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x
+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x
)*exp(4*I*e)-2*n^2*B/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/
2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp
(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*ex
p(2*I*f*x)*exp(2*I*e)+2*I*n*A/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*n*(
csgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+6*B/
((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*n*(csgn(I*c/(exp(2*I*(f*x+e))+1))
-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+6*I*A/((exp(2*I*(f*x+e))+1)^n)*2^n
*c^n*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*n*(csgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)
))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+I*n^3*A/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*Pi*csgn(I*
c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/
(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)
*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+I*n^3*A/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*exp(-1/2*I*P
i*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*
csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*
csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+12*I*n*A/((exp(2*I*(f*x+e))+1)^n)*2^n*c^n*ex
p(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp
(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*
x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1)...
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 1099 vs. \(2 (141) = 282\).
time = 0.70, size = 1099, normalized size = 7.28 \begin {gather*} \frac {4 \, {\left (2 \, {\left ({\left (A + i \, B\right )} a^{3} c^{n} n^{2} + 6 \, A a^{3} c^{n} n + 9 \, {\left (A - i \, B\right )} a^{3} c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + {\left ({\left (A + i \, B\right )} a^{3} c^{n} n^{3} + 2 \, {\left (4 \, A + i \, B\right )} a^{3} c^{n} n^{2} + 3 \, {\left (7 \, A - 3 i \, B\right )} a^{3} c^{n} n + 18 \, {\left (A - i \, B\right )} a^{3} c^{n}\right )} 2^{n} \cos \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right ) + {\left ({\left (A - i \, B\right )} a^{3} c^{n} n^{3} + 6 \, {\left (A - i \, B\right )} a^{3} c^{n} n^{2} + 11 \, {\left (A - i \, B\right )} a^{3} c^{n} n + 6 \, {\left (A - i \, B\right )} a^{3} c^{n}\right )} 2^{n} \cos \left (-6 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 6 \, e\right ) + 2 \, {\left ({\left (A + i \, B\right )} a^{3} c^{n} n + 3 \, {\left (A - i \, B\right )} a^{3} c^{n}\right )} 2^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - 2 \, {\left ({\left (i \, A - B\right )} a^{3} c^{n} n^{2} + 6 i \, A a^{3} c^{n} n + 9 \, {\left (i \, A + B\right )} a^{3} c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) - {\left ({\left (i \, A - B\right )} a^{3} c^{n} n^{3} + 2 \, {\left (4 i \, A - B\right )} a^{3} c^{n} n^{2} + 3 \, {\left (7 i \, A + 3 \, B\right )} a^{3} c^{n} n + 18 \, {\left (i \, A + B\right )} a^{3} c^{n}\right )} 2^{n} \sin \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right ) - {\left ({\left (i \, A + B\right )} a^{3} c^{n} n^{3} + 6 \, {\left (i \, A + B\right )} a^{3} c^{n} n^{2} + 11 \, {\left (i \, A + B\right )} a^{3} c^{n} n + 6 \, {\left (i \, A + B\right )} a^{3} c^{n}\right )} 2^{n} \sin \left (-6 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 6 \, e\right ) - 2 \, {\left ({\left (i \, A - B\right )} a^{3} c^{n} n + 3 \, {\left (i \, A + B\right )} a^{3} c^{n}\right )} 2^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )\right )}}{{\left ({\left (-i \, n^{4} - 6 i \, n^{3} - 11 i \, n^{2} - 6 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \cos \left (6 \, f x + 6 \, e\right ) - 3 \, {\left (i \, n^{4} + 6 i \, n^{3} + 11 i \, n^{2} + 6 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \cos \left (4 \, f x + 4 \, e\right ) + {\left (n^{4} + 6 \, n^{3} + 11 \, n^{2} + 6 \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \sin \left (6 \, f x + 6 \, e\right ) + 3 \, {\left (n^{4} + 6 \, n^{3} + 11 \, n^{2} + 6 \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \sin \left (4 \, f x + 4 \, e\right ) + {\left (-i \, n^{4} - 6 i \, n^{3} - 11 i \, n^{2} - 3 \, {\left (i \, n^{4} + 6 i \, n^{3} + 11 i \, n^{2} + 6 i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) + 3 \, {\left (n^{4} + 6 \, n^{3} + 11 \, n^{2} + 6 \, n\right )} \sin \left (2 \, f x + 2 \, e\right ) - 6 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n}\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="maxima")
[Out]
4*(2*((A + I*B)*a^3*c^n*n^2 + 6*A*a^3*c^n*n + 9*(A - I*B)*a^3*c^n)*2^n*cos(-2*f*x + n*arctan2(sin(2*f*x + 2*e)
, cos(2*f*x + 2*e) + 1) - 2*e) + ((A + I*B)*a^3*c^n*n^3 + 2*(4*A + I*B)*a^3*c^n*n^2 + 3*(7*A - 3*I*B)*a^3*c^n*
n + 18*(A - I*B)*a^3*c^n)*2^n*cos(-4*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e) + ((A - I*
B)*a^3*c^n*n^3 + 6*(A - I*B)*a^3*c^n*n^2 + 11*(A - I*B)*a^3*c^n*n + 6*(A - I*B)*a^3*c^n)*2^n*cos(-6*f*x + n*ar
ctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 6*e) + 2*((A + I*B)*a^3*c^n*n + 3*(A - I*B)*a^3*c^n)*2^n*cos(n
*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - 2*((I*A - B)*a^3*c^n*n^2 + 6*I*A*a^3*c^n*n + 9*(I*A + B)*a
^3*c^n)*2^n*sin(-2*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 2*e) - ((I*A - B)*a^3*c^n*n^3 + 2
*(4*I*A - B)*a^3*c^n*n^2 + 3*(7*I*A + 3*B)*a^3*c^n*n + 18*(I*A + B)*a^3*c^n)*2^n*sin(-4*f*x + n*arctan2(sin(2*
f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e) - ((I*A + B)*a^3*c^n*n^3 + 6*(I*A + B)*a^3*c^n*n^2 + 11*(I*A + B)*a^3
*c^n*n + 6*(I*A + B)*a^3*c^n)*2^n*sin(-6*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 6*e) - 2*((
I*A - B)*a^3*c^n*n + 3*(I*A + B)*a^3*c^n)*2^n*sin(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)))/(((-I*n^
4 - 6*I*n^3 - 11*I*n^2 - 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos
(6*f*x + 6*e) - 3*(I*n^4 + 6*I*n^3 + 11*I*n^2 + 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x
+ 2*e) + 1)^(1/2*n)*cos(4*f*x + 4*e) + (n^4 + 6*n^3 + 11*n^2 + 6*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 +
2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(6*f*x + 6*e) + 3*(n^4 + 6*n^3 + 11*n^2 + 6*n)*(cos(2*f*x + 2*e)^2 + sin(2
*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(4*f*x + 4*e) + (-I*n^4 - 6*I*n^3 - 11*I*n^2 - 3*(I*n^4 + 6
*I*n^3 + 11*I*n^2 + 6*I*n)*cos(2*f*x + 2*e) + 3*(n^4 + 6*n^3 + 11*n^2 + 6*n)*sin(2*f*x + 2*e) - 6*I*n)*(cos(2*
f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n))*f)
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 342 vs. \(2 (141) = 282\).
time = 2.72, size = 342, normalized size = 2.26 \begin {gather*} -\frac {4 \, {\left (2 \, {\left (-i \, A + B\right )} a^{3} n + 6 \, {\left (-i \, A - B\right )} a^{3} + {\left ({\left (-i \, A - B\right )} a^{3} n^{3} + 6 \, {\left (-i \, A - B\right )} a^{3} n^{2} + 11 \, {\left (-i \, A - B\right )} a^{3} n + 6 \, {\left (-i \, A - B\right )} a^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left ({\left (-i \, A + B\right )} a^{3} n^{3} + 2 \, {\left (-4 i \, A + B\right )} a^{3} n^{2} + 3 \, {\left (-7 i \, A - 3 \, B\right )} a^{3} n + 18 \, {\left (-i \, A - B\right )} a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left ({\left (-i \, A + B\right )} a^{3} n^{2} - 6 i \, A a^{3} n + 9 \, {\left (-i \, A - B\right )} a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n + {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="fricas")
[Out]
-4*(2*(-I*A + B)*a^3*n + 6*(-I*A - B)*a^3 + ((-I*A - B)*a^3*n^3 + 6*(-I*A - B)*a^3*n^2 + 11*(-I*A - B)*a^3*n +
6*(-I*A - B)*a^3)*e^(6*I*f*x + 6*I*e) + ((-I*A + B)*a^3*n^3 + 2*(-4*I*A + B)*a^3*n^2 + 3*(-7*I*A - 3*B)*a^3*n
+ 18*(-I*A - B)*a^3)*e^(4*I*f*x + 4*I*e) + 2*((-I*A + B)*a^3*n^2 - 6*I*A*a^3*n + 9*(-I*A - B)*a^3)*e^(2*I*f*x
+ 2*I*e))*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n/(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n + (f*n^4 + 6*f*n^3 + 11*f*n^2
+ 6*f*n)*e^(6*I*f*x + 6*I*e) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(4*I*f*x + 4*I*e) + 3*(f*n^4 + 6*f*n^
3 + 11*f*n^2 + 6*f*n)*e^(2*I*f*x + 2*I*e))
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 3665 vs. \(2 (122) = 244\).
time = 3.47, size = 3665, normalized size = 24.27 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**n,x)
[Out]
Piecewise((x*(A + B*tan(e))*(I*a*tan(e) + a)**3*(-I*c*tan(e) + c)**n, Eq(f, 0)), (6*A*a**3*tan(e + f*x)**2/(6*
c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 2*A*a**3/(6*c**3
*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 6*I*B*a**3*f*x*tan(e
+ f*x)**3/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 18
*B*a**3*f*x*tan(e + f*x)**2/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) -
6*I*c**3*f) - 18*I*B*a**3*f*x*tan(e + f*x)/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*
f*tan(e + f*x) - 6*I*c**3*f) + 6*B*a**3*f*x/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*
f*tan(e + f*x) - 6*I*c**3*f) - 3*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**3/(6*c**3*f*tan(e + f*x)**3 + 1
8*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 9*I*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e
+ f*x)**2/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 9*B
*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*
f*tan(e + f*x) - 6*I*c**3*f) + 3*I*B*a**3*log(tan(e + f*x)**2 + 1)/(6*c**3*f*tan(e + f*x)**3 + 18*I*c**3*f*tan
(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) - 30*I*B*a**3*tan(e + f*x)**2/(6*c**3*f*tan(e + f*x)**3 +
18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 36*B*a**3*tan(e + f*x)/(6*c**3*f*tan(e +
f*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f) + 14*I*B*a**3/(6*c**3*f*tan(e + f
*x)**3 + 18*I*c**3*f*tan(e + f*x)**2 - 18*c**3*f*tan(e + f*x) - 6*I*c**3*f), Eq(n, -3)), (2*A*a**3*f*x*tan(e +
f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 4*I*A*a**3*f*x*tan(e + f*x)/(2*c**2
*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 2*A*a**3*f*x/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f
*tan(e + f*x) - 2*c**2*f) + I*A*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*
c**2*f*tan(e + f*x) - 2*c**2*f) - 2*A*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4
*I*c**2*f*tan(e + f*x) - 2*c**2*f) - I*A*a**3*log(tan(e + f*x)**2 + 1)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*
tan(e + f*x) - 2*c**2*f) - 8*A*a**3*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*
f) - 4*I*A*a**3/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 10*I*B*a**3*f*x*tan(e + f*x)
**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 20*B*a**3*f*x*tan(e + f*x)/(2*c**2*f*tan
(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 10*I*B*a**3*f*x/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*ta
n(e + f*x) - 2*c**2*f) + 5*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**
2*f*tan(e + f*x) - 2*c**2*f) + 10*I*B*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4
*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 5*B*a**3*log(tan(e + f*x)**2 + 1)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*
tan(e + f*x) - 2*c**2*f) + 2*I*B*a**3*tan(e + f*x)**3/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*
c**2*f) + 22*I*B*a**3*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 16*B*a**3
/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f), Eq(n, -2)), (-8*A*a**3*f*x*tan(e + f*x)/(2*c
*f*tan(e + f*x) + 2*I*c*f) - 8*I*A*a**3*f*x/(2*c*f*tan(e + f*x) + 2*I*c*f) - 4*I*A*a**3*log(tan(e + f*x)**2 +
1)*tan(e + f*x)/(2*c*f*tan(e + f*x) + 2*I*c*f) + 4*A*a**3*log(tan(e + f*x)**2 + 1)/(2*c*f*tan(e + f*x) + 2*I*c
*f) + 2*A*a**3*tan(e + f*x)**2/(2*c*f*tan(e + f*x) + 2*I*c*f) + 10*A*a**3/(2*c*f*tan(e + f*x) + 2*I*c*f) + 16*
I*B*a**3*f*x*tan(e + f*x)/(2*c*f*tan(e + f*x) + 2*I*c*f) - 16*B*a**3*f*x/(2*c*f*tan(e + f*x) + 2*I*c*f) - 8*B*
a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c*f*tan(e + f*x) + 2*I*c*f) - 8*I*B*a**3*log(tan(e + f*x)**2 + 1
)/(2*c*f*tan(e + f*x) + 2*I*c*f) + B*a**3*tan(e + f*x)**3/(2*c*f*tan(e + f*x) + 2*I*c*f) - 7*I*B*a**3*tan(e +
f*x)**2/(2*c*f*tan(e + f*x) + 2*I*c*f) - 16*I*B*a**3/(2*c*f*tan(e + f*x) + 2*I*c*f), Eq(n, -1)), (4*A*a**3*x +
2*I*A*a**3*log(tan(e + f*x)**2 + 1)/f - I*A*a**3*tan(e + f*x)**2/(2*f) - 3*A*a**3*tan(e + f*x)/f - 4*I*B*a**3
*x + 2*B*a**3*log(tan(e + f*x)**2 + 1)/f - I*B*a**3*tan(e + f*x)**3/(3*f) - 3*B*a**3*tan(e + f*x)**2/(2*f) + 4
*I*B*a**3*tan(e + f*x)/f, Eq(n, 0)), (-I*A*a**3*n**3*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)**2/(f*n**4 + 6*f*
n**3 + 11*f*n**2 + 6*f*n) - 2*A*a**3*n**3*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n**4 + 6*f*n**3 + 11*f*n*
*2 + 6*f*n) + I*A*a**3*n**3*(-I*c*tan(e + f*x) + c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 4*I*A*a**3*n*
*2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)**2/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) - 12*A*a**3*n**2*(-I*c*t
an(e + f*x) + c)**n*tan(e + f*x)/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n) + 8*I*A*a**3*n**2*(-I*c*tan(e + f*x)
+ c)**n/(f*n**4 + 6*f*n**3 + 11*f*n**2 + 6*f*n)...
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="giac")
[Out]
integrate((B*tan(f*x + e) + A)*(I*a*tan(f*x + e) + a)^3*(-I*c*tan(f*x + e) + c)^n, x)
________________________________________________________________________________________
Mupad [B]
time = 13.88, size = 323, normalized size = 2.14 \begin {gather*} -\frac {{\left (c+\frac {c\,\left ({\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )\,1{}\mathrm {i}}{{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1}\right )}^n\,\left (\frac {8\,a^3\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {4\,a^3\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,\left (n^2+5\,n+6\right )\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {4\,a^3\,{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}\,\left (A-B\,1{}\mathrm {i}\right )\,\left (n^3+6\,n^2+11\,n+6\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}+\frac {8\,a^3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,\left (n+3\right )\,\left (3\,A-B\,3{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n^3\,1{}\mathrm {i}+n^2\,6{}\mathrm {i}+n\,11{}\mathrm {i}+6{}\mathrm {i}\right )}\right )}{3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}+{\mathrm {e}}^{e\,6{}\mathrm {i}+f\,x\,6{}\mathrm {i}}+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3*(c - c*tan(e + f*x)*1i)^n,x)
[Out]
-((c + (c*(exp(e*2i + f*x*2i)*1i - 1i)*1i)/(exp(e*2i + f*x*2i) + 1))^n*((8*a^3*(3*A - B*3i + A*n + B*n*1i))/(f
*n*(n*11i + n^2*6i + n^3*1i + 6i)) + (4*a^3*exp(e*4i + f*x*4i)*(5*n + n^2 + 6)*(3*A - B*3i + A*n + B*n*1i))/(f
*n*(n*11i + n^2*6i + n^3*1i + 6i)) + (4*a^3*exp(e*6i + f*x*6i)*(A - B*1i)*(11*n + 6*n^2 + n^3 + 6))/(f*n*(n*11
i + n^2*6i + n^3*1i + 6i)) + (8*a^3*exp(e*2i + f*x*2i)*(n + 3)*(3*A - B*3i + A*n + B*n*1i))/(f*n*(n*11i + n^2*
6i + n^3*1i + 6i))))/(3*exp(e*2i + f*x*2i) + 3*exp(e*4i + f*x*4i) + exp(e*6i + f*x*6i) + 1)
________________________________________________________________________________________